package com.blockmeta.bbs.immodule.widget;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.blockmeta.bbs.baselibrary.widget.popupview.BaseBottomPopupWindow;
import com.blockmeta.bbs.businesslibrary.widget.RoundCornerTextView;
import com.blockmeta.bbs.immodule.R;


public class Popup_Circle_Desc extends BaseBottomPopupWindow implements View.OnClickListener {

    private TextView circleDescTitle;
    private TextView circleDescContent;
    private TextView circleOwnerDescTitle;
    private TextView circleOwnerDescContent;
    private RoundCornerTextView imPopupSysBtnAction;


    public Popup_Circle_Desc(Context context, String circleDesc, String ownerDesc) {
        super(context);
        if(!TextUtils.isEmpty(circleDesc)){
            circleDescContent.setText(circleDesc);
        }else {
            circleDescTitle.setVisibility(View.GONE);
            circleDescContent.setVisibility(View.GONE);
        }
        if(!TextUtils.isEmpty(ownerDesc)){
            circleOwnerDescContent.setText(ownerDesc);
        }else {
            circleOwnerDescTitle.setVisibility(View.GONE);
            circleOwnerDescContent.setVisibility(View.GONE);
        }
    }


    @Override
    public int getResId() {
        return R.layout.im_popup_circledesc;
    }

    @Override
    protected void bindEvent() {

        circleDescTitle = (TextView) findViewById(R.id.circle_desc_title);
        circleDescContent = (TextView) findViewById(R.id.circle_desc_content);
        circleOwnerDescTitle = (TextView) findViewById(R.id.circle_owner_desc_title);
        circleOwnerDescContent = (TextView) findViewById(R.id.circle_owner_desc_content);
        imPopupSysBtnAction = (RoundCornerTextView) findViewById(R.id.im_popup_sys_btn_action);
        imPopupSysBtnAction.setOnClickListener(this);

    }

    @Override
    public View getClickToDismissView() {
        return popupView.findViewById(R.id.iv_hongbao_close);
    }


    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.im_popup_sys_btn_action) {
            dismiss();
        }
    }

    public void showPop() {
        if (!isShowing()) {
            showPopupWindow();
        }
    }

    @Override
    public View initAnimaView() {
        return null;
    }
}
